# schemas/summary.py
from typing import Union
from datetime import datetime
from pydantic import Field
from fastapi import Query

from admin.schemas.base import CamelModel


class MeetingsSummaryListIn(CamelModel):
    meeting_id: Union[int, None] = Field(default=None)

    class Config:
        from_attributes = True
        field_operator_mapping = {
            "meeting_id": "=",
        }


class MeetingsSummaryDetailIn(CamelModel):
    id: int = Query(..., gt=0)


class MeetingsSummaryAddIn(CamelModel):
    meeting_id: int
    content: str
    model_name: Union[str, None] = None


class MeetingsSummaryEditIn(MeetingsSummaryAddIn):
    id: int = Field(..., gt=0)


class MeetingsSummaryDelIn(CamelModel):
    id: int = Field(..., gt=0)


class MeetingsSummaryOut(CamelModel):
    id: int
    meeting_id: int
    content: str
    model_name: Union[str, None]
    created_at: Union[datetime, None]

    class Config:
        from_attributes = True
